package com.xj.oop1;

public class Student extends Person {
    private int score;

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public void setAge(int age) {
        if (age < 4) {
            this.age = 4;
            System.out.println("年龄不能小于4岁");
        } else {
            this.age = age;
        }
    }

    public void intro() {
        System.out.println("我是" + name + ",今年" + age + "岁,考试"+score+"分");
    }
}
